﻿using System;

public class DepostiAccount:Account,IDrow
{
    private int period;
    public DepostiAccount(Customer customer, decimal balance, decimal interest, int period)
        : base(customer, balance, interest)
    {
        this.period = period;

    }
    public override void Deposit(decimal money)
    {
        this.Balance += money;

    }
    public override void Drow(decimal money)
    {
        if (this.Balance > money)
        {
            this.Balance = this.Balance - money;

        }
        else
        {
            throw new Exception("Not enough money in the account");

        }

    }
    public override decimal CalculateInterest()
    {
        if (this.Balance <= 1000)
        {
            return 0;
        }
        else
        {
            return this.period * this.Interest;

        }
    }

}